package com.share.rxjava.reactor;

import reactor.core.publisher.Flux;

import java.util.Arrays;
import java.util.List;

/**
 * @desc:
 * @author:caifan
 * @date:2020/6/13
 */
public class MyFlux {

    public static void main(String[] args) {
        Flux<String> seq = Flux.just("java", "python", "C#");
        List<String> strings = Arrays.asList("java", "python", "C++");
        Flux<String> stringFlux = Flux.fromIterable(strings);
        stringFlux.subscribe(System.out::println);
        seq.subscribe(System.out::println);
        System.out.println("=========");
        Flux<Integer> range = Flux.range(1, 5);//从1开始产生5个值
        range.subscribe(i -> System.out.println(i*i));
    }
}
